//
//  SEGServiceEvaluationManager.m
//  TableDemo
//
//  Created by Clavis on 2019/6/13.
//  Copyright © 2019 Clavis. All rights reserved.
//

#import "SEGServiceEvaluationManager.h"

@implementation SEGServiceEvaluationManager

/**
 请求评价列表

 @param pageNo 当前页数
 @param finished 回调
 */
+ (void)requestEvaluationListWithPageNo:(NSInteger)pageNo finished:(SEGNetworkReponse)finished {
    NSString *urlString = [SEGServerManager serverUrlJoint:kClientRootURL,@"/bms-api/rating/queryAppRating",nil];
    
    NSDictionary *param = @{@"pageNo" : @(pageNo),
                            @"pageLimit" : @(20),
                            @"communityId" : kAccountCommunityID,
                            @"platform" : kAppPlatformCode
                            };
    
    [SEGHTTPBusinessManager seg_requestWithMethod:GET URLString:urlString parameters:param finished:^(BOOL isSuccessed, id result, NSString *codeType, NSString *errorMessage) {
        finished(isSuccessed, result, codeType, errorMessage);
    }];
}

/**
 提交评价

 @param param param
 @param finished finished
 */
+ (void)requestSubmitEvaluationWithParam:(NSDictionary *)param finished:(SEGNetworkReponse)finished {
    NSString *urlString = [SEGServerManager serverUrlJoint:kClientRootURL,@"/bms-api/rating/appraise",nil];
    
    [SEGHTTPBusinessManager seg_requestJSONWithMethod:POST URLString:urlString parameters:param finished:^(BOOL isSuccessed, id result, NSString *codeType, NSString *errorMessage) {
        finished(isSuccessed, result, codeType, errorMessage);
    }];
}

@end
